package com.zyz.E_面向对象.J_多态.引出;

/**
 * @author: vick
 * @Date: 2025/3/16
 * @Description:
 * @version: 1.0
 */
public class Test {
    //没有多态的的话，
   /* public void func(Dog dog) {
        dog.call();
    }

    public void func(Cat cat) {
        cat.call();
    }*/

    public void func(Animal animal) {//Animal animal = new Dog()
        animal.call();
    }

    public static void main(String[] args) {
        Test test = new Test();
        test.func(new Dog());
        test.func(new Cat());
    }

}
